#include "DialogNoteList.h"

//(*InternalHeaders(DialogNoteList)
#include <wx/intl.h>
#include <wx/string.h>
//*)

//(*IdInit(DialogNoteList)
const long DialogNoteList::ID_LISTCTRL1 = wxNewId();
const long DialogNoteList::ID_BUTTON1 = wxNewId();
const long DialogNoteList::ID_BUTTON2 = wxNewId();
const long DialogNoteList::ID_BUTTON3 = wxNewId();
//*)

BEGIN_EVENT_TABLE(DialogNoteList,wxDialog)
	//(*EventTable(DialogNoteList)
	//*)
END_EVENT_TABLE()

DialogNoteList::DialogNoteList(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
	//(*Initialize(DialogNoteList)
	Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("id"));
	SetClientSize(wxSize(568,608));
	Move(wxDefaultPosition);
	ListCtrl1 = new wxListCtrl(this, ID_LISTCTRL1, wxPoint(24,32), wxSize(512,368), 0, wxDefaultValidator, _T("ID_LISTCTRL1"));
	Button1 = new wxButton(this, ID_BUTTON1, _("查看/编辑"), wxPoint(56,504), wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
	Button2 = new wxButton(this, ID_BUTTON2, _("关闭"), wxPoint(368,504), wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
	Button3 = new wxButton(this, ID_BUTTON3, _("增加"), wxPoint(208,504), wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON3"));
	
	Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DialogNoteList::OnEdit);
	Connect(ID_BUTTON2,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DialogNoteList::OnClose);
	Connect(ID_BUTTON3,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DialogNoteList::OnAddNote);
	//*)

	DlgNote = new DialogEditNote(this);
	DlgNote->Show(false);
}

DialogNoteList::~DialogNoteList()
{
	//(*Destroy(DialogNoteList)
	//*)

	if(DlgNote)
        delete DlgNote;
}


void DialogNoteList::OnClose(wxCommandEvent& event)
{
    this->Show(false);
}

void DialogNoteList::OnEdit(wxCommandEvent& event)
{
    DlgNote->Show(true);
}

void DialogNoteList::OnAddNote(wxCommandEvent& event)
{
    DlgNote->Show(true);
}
